package cn.liujianbo.example.pattern.decorator;

import lombok.Getter;

import java.math.BigDecimal;

/**
 * @author 刘建波
 * @date 2022-03-04 13:49
 */
@Getter
public abstract class GarnishDecorator extends FastFood {
    private final FastFood fastFood;

    protected GarnishDecorator(FastFood fastFood, String name, BigDecimal price) {
        super(name, price);
        this.fastFood = fastFood;
    }

    @Override
    public String getName() {
        return fastFood.getName() + super.getName();
    }
}
